package com.jindy.module.workreport.service.impl;

import java.util.List;
import com.jindy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jindy.module.workreport.mapper.WorkReportMapper;
import com.jindy.module.workreport.domain.WorkReport;
import com.jindy.module.workreport.service.IWorkReportService;

/**
 * 工作日报Service业务层处理
 * 
 * @author jindy
 * @date 2023-02-22
 */
@Service
public class WorkReportServiceImpl implements IWorkReportService 
{
    @Autowired
    private WorkReportMapper workReportMapper;

    /**
     * 查询工作日报
     * 
     * @param id 工作日报主键
     * @return 工作日报
     */
    @Override
    public WorkReport selectWorkReportById(Long id)
    {
        return workReportMapper.selectWorkReportById(id);
    }

    /**
     * 查询工作日报列表
     * 
     * @param workReport 工作日报
     * @return 工作日报
     */
    @Override
    public List<WorkReport> selectWorkReportList(WorkReport workReport)
    {
        return workReportMapper.selectWorkReportList(workReport);
    }

    /**
     * 新增工作日报
     * 
     * @param workReport 工作日报
     * @return 结果
     */
    @Override
    public int insertWorkReport(WorkReport workReport)
    {
        workReport.setCreateTime(DateUtils.getNowDate());
        return workReportMapper.insertWorkReport(workReport);
    }

    /**
     * 修改工作日报
     * 
     * @param workReport 工作日报
     * @return 结果
     */
    @Override
    public int updateWorkReport(WorkReport workReport)
    {
        workReport.setUpdateTime(DateUtils.getNowDate());
        return workReportMapper.updateWorkReport(workReport);
    }

    /**
     * 批量删除工作日报
     * 
     * @param ids 需要删除的工作日报主键
     * @return 结果
     */
    @Override
    public int deleteWorkReportByIds(Long[] ids)
    {
        return workReportMapper.deleteWorkReportByIds(ids);
    }

    /**
     * 删除工作日报信息
     * 
     * @param id 工作日报主键
     * @return 结果
     */
    @Override
    public int deleteWorkReportById(Long id)
    {
        return workReportMapper.deleteWorkReportById(id);
    }
}
